<!DOCTYPE html>
<html lang="en">

<head>
    <title>productList</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" href="css/bootstrap.css">
    <link href="css/style.css" rel="stylesheet" type="text/css" media="all"/>
    <link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/font-awesome.4.6.0.css"><!-- 图标样式 -->
    <link rel="stylesheet" type="text/css" href="./css/goodDetail.css">
    <link href="css/owl.carousel.css" rel="stylesheet" type="text/css" media="all">

    <script src="js/jquery-2.2.3.min.js"></script>
    <script src="js/jquery-scrolltofixed-min.js" type="text/javascript"></script><!-- 导航栏 -->
    <script type="text/javascript" src="js/move-top.js"></script>
    <script type="text/javascript" src="js/easing.js"></script>
    <script src="js/bootstrap.js"></script>
    <script src="js/main.js"></script>
    <script src="js/owl.carousel.js"></script>
    <script src="js/jquery.menu-aim.js"></script>
    <script src="js/custom.js"></script>


</head>

<body>
<div id="app">
    <div class="header">
        <div class="header">
            <div class="w3ls-header">
                <div class="w3ls-header-left">
                    <p>
                        <a href="#"><img style="position: relative;left: -10px; top: -1px" src="./images/shopping.png">
                            XB全新高端购物平台
                        </a>
                    </p>
                </div>
                <div class="w3ls-header-right">
                    <ul>
                        <li class="dropdown head-dpdn">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="fa fa-user" aria-hidden="true"></i>人名<span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li><a href="profile.html">个人中心</a></li>
                                <li><a @click="exitLogin()" href="#" @click.prevent="">注销</a></li>
                            </ul>
                        </li>
                        <li class="dropdown head-dpdn">
                            <a href="car.html" class="dropdown-toggle"><i class="fa fa-gift" aria-hidden="true"></i>购物车</a>
                        </li>
                        <li class="dropdown head-dpdn">
                            <a href="waitPay.html" class="dropdown-toggle">
                                <i class="fa fa-credit-card-alt" aria-hidden="true"></i>待支付</a>
                        </li>
                    </ul>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="header-two">
                <div class="container">
                    <div class="header-logo">
                        <h1><a href="home.html"><span>X</span>Biao </a></h1>
                        <h6>Your stores. Your place.</h6>
                    </div>
                    <div class="header-search">
                        <form @submit.stop="">
                            <input v-model="goodsName" type="search" name="Search" placeholder="Search for a Product..." required="">
                            <button @click="search()" type="button" class="btn btn-default" >
                                <i class="fa fa-search" aria-hidden="true"> </i>
                            </button>
                        </form>
                    </div>
                    <div class="header-cart">
                        <div class="my-account">
                            <a href="javascript:;"></a>
                        </div>
                        <div class="cart">
                            <a href="car.html">
                                <button class="w3view-cart" type="submit" name="submit" value=""><i
                                        class="fa fa-cart-arrow-down" aria-hidden="true"></i></button>
                            </a>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
            <div class="header-three">
                <div class="container">
                    <ul class="nav nav-pills nav-justified">
                        <li><a href="#" @click="toGoodsListByType(0)">全部列表</a></li>
                        <li v-for="type in types"><a href="#" @click="toGoodsListByType(type.id)" @c>{{type.goodsType}}</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <!-- products -->
    <div class="products">
        <div class="container">
            <div class="col-md-12 product-w3ls-right">
                <!-- breadcrumbs -->
                <ol class="breadcrumb breadcrumb1">
                    <li><a href="home.html">Home</a></li>
                    <li class="active">{{typeName}}</li>
                </ol>
                <!-- //breadcrumbs -->

                <div class="products-row">
                    <div v-for="goods in goodsPage.list" class="col-md-3 product-grids" style="height: 380px;width: 285px">
                        <div class="agile-products">
                            <div class="new-tag">
                                <h6>TOP1 <br> Hot</h6>
                            </div>
                            <a @click="toDetail(goods)" href="#" @click.prevent="">
                                <img :src="goods.pic" style="height: 253px;width: 211px;" class="img-responsive" alt="img"></a>
                            <div class="agile-product-text">
                                <h5><a @click="toDetail(goods)" @click.prevent="" href="#">{{goods.goodName}}</a></h5>
                                <h6>${{goods.price}}</h6>
                                <h6>{{goods.storeName}}</h6>
                                <button style="margin-left: 10px" @click="toDetail(goods)"  type="submit" class="w3ls-cart pw3ls-cart">
                                    <i class="fa fa-cart-plus" aria-hidden="true"></i>查看详情
                                </button>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-12">
                        <nav class="navbar-right" aria-label="Page navigation">
                            <ul class="pagination">
                                <!--上一页-->
                                <li :class="goodsPage.pageNum==1?'disabled':''">
                                    <a href="#" aria-label="Previous" @click="getAllGoods(goodsPage.pageNum-1)"
                                       v-if="goodsPage.pageNum>1" @click.prevent="">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                    <a aria-label="Previous" v-else="">
                                        <span aria-hidden="true">&laquo;</span>
                                    </a>
                                </li>
                                <!--页数-->
                                <li :class="pageNo==goodsPage.pageNum?'active':''" v-for="pageNo in goodsPage.pages">
                                    <a v-if="pageNo==goodsPage.pageNum" @click.prevent="">{{pageNo}}</a>
                                    <a v-else href="#" @click="getAllGoods(pageNo)" @click.prevent="">{{pageNo}}</a>
                                </li>
                                <!--下一页-->
                                <li :class="goodsPage.pageNum==goodsPage.pages?'disabled':''">
                                    <a href="#" aria-label="Next" @click="getAllGoods(goodsPage.pageNum+1)"
                                       v-if="goodsPage.pageNum<goodsPage.pages" @click.prevent="">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                    <a aria-label="Previous" v-else="">
                                        <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                            </ul>
                        </nav>
                    </div>
                    <div class="clearfix"></div>
                </div>

                <!-- //add-products -->
            </div>
            <div class="clearfix"></div>
        </div>
    </div>
    <!--//products-->

    <!--最热商品-->
    <div class="add-products">
        <h3 class="w3ls-title">热卖商品</h3>
        <div class="container">
            <div v-for="goods in hotGoodsList" class=" w3ls-add-grids">
                <a href="#" @click="toDetail(goods)" @click.prevent="">
                    <img :src="goods.pic">
                    <p>{{goods.goodName}}<span>${{goods.price}}</span></p>
                    <span>Shop now <i class="fa fa-arrow-circle-right" aria-hidden="true"></i></span>
                </a>
            </div>
        </div>
    </div>

    <div class="copy-right">
        <div class="container">
            <p>Copyright &copy; 2020.XB All rights reserved.<a target="_blank" href="#"></a></p>
        </div>
    </div>
</div>
</body>
<script src="vue/vue-2.6.11.js"></script>
<script src="vue/axios-0.19.2.min.js"></script>
<script src="vue/layer.js"></script>
<script src="myjs/productList.js"></script>
</html>